package view;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JRadioButton;
import javax.swing.JTextField;

public class Fenetre{
    
    private ButtonGroup jBGroupMC;
    private JRadioButton jRadioMCMulti;
    private JRadioButton jRadioMCSingle;
    private JButton jButtonValidate;
    private JComboBox jComboSet;
    private JProgressBar barre;
    private JPanel jPanRB;

    private JTextField jTextFieldCallPutFlag;
    private JTextField jTextFieldS;
    private JTextField jTextFieldX;
    private JTextField jTextFieldT;
    private JTextField jTextFieldr;
    private JTextField jTextFieldb;
    private JTextField jTextFieldv;
    private JTextField jTextFieldnSteps;
    private JTextField jTextFieldnSimulations;
    private JLabel valeurSeconde;
    private JLabel valeurFinal;
    

    private JFrame jframe1;

    private String set[] = {"Set1", "Set2", "Set3", "Set4", "Set5"};
	
    private int numSet = 0;
	
	public Fenetre() {
		Menu();
		
		jframe1.setVisible(true); //affiche la JFrame
       // jframe1.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
	}

    
    
	public void Menu() {

	        jframe1 = new javax.swing.JFrame();
	        jBGroupMC = new ButtonGroup();
	        jRadioMCMulti = new JRadioButton("Multi Threads");
	        jRadioMCSingle = new JRadioButton("Single Thread");
	        jButtonValidate = new JButton("Send !");
	        jPanRB = new JPanel();
	        jComboSet = new JComboBox(set);
	        barre = new JProgressBar(0, 99);
	        valeurSeconde = new JLabel();
	        valeurFinal = new JLabel();
	        
	        jTextFieldCallPutFlag = new JTextField();
	        jTextFieldS = new JTextField();
	        jTextFieldX = new JTextField();
	        jTextFieldT = new JTextField();
	        jTextFieldr = new JTextField();
	        jTextFieldb = new JTextField();
	        jTextFieldv = new JTextField();
	        jTextFieldnSteps = new JTextField();
	        jTextFieldnSimulations = new JTextField();

	        // Affichage de la jdialog affichait de base
	        jframe1.setTitle("__ :: Monte Carlo :: __");
	        jframe1.setMinimumSize(new java.awt.Dimension(300, 400));
	        jframe1.setBounds(200, 5, 300, 300);
	        jframe1.setResizable(false);
	        jframe1.getContentPane().setLayout(null);
	        
	        // On initialiser la progress bar
//	        barre.setString("progression");
//	        barre.setStringPainted(true);
//	        jframe1.getContentPane().add(barre);
//	        barre.setBounds(50,220,200,20);
	        
	        jRadioMCMulti.setBounds(30, 20, 130, 20);
	        jRadioMCSingle.setBounds(160, 20, 280, 20);
	        
	        jBGroupMC.add(jRadioMCMulti);
	        jBGroupMC.add(jRadioMCSingle);
	        
	        jComboSet.setBounds(80, 50, 140, 20);
	        
	        jTextFieldCallPutFlag.setText("CallPutFlag");
	        jframe1.getContentPane().add(jTextFieldCallPutFlag);
	        jTextFieldCallPutFlag.setBounds(10, 80, 100, 20);
	        
	        jTextFieldS.setText("CallPutFlag");
	        jframe1.getContentPane().add(jTextFieldS);
	        jTextFieldS.setBounds(10, 110, 100, 20);
	        
	        jTextFieldX.setText("X");
	        jframe1.getContentPane().add(jTextFieldX);
	        jTextFieldX.setBounds(10, 140, 100, 20);
	        
	        jTextFieldT.setText("T");
	        jframe1.getContentPane().add(jTextFieldT);
	        jTextFieldT.setBounds(10, 170, 100, 20);
	        
	        jTextFieldr.setText("r");
	        jframe1.getContentPane().add(jTextFieldr);
	        jTextFieldr.setBounds(190, 80, 100, 20);
	        
	        jTextFieldb.setText("b");
	        jframe1.getContentPane().add(jTextFieldb);
	        jTextFieldb.setBounds(190, 110, 100, 20);
	        
	        jTextFieldv.setText("v");
	        jframe1.getContentPane().add(jTextFieldv);
	        jTextFieldv.setBounds(190, 140, 100, 20);
	        
	        jTextFieldnSteps.setText("nSteps");
	        jframe1.getContentPane().add(jTextFieldnSteps);
	        jTextFieldnSteps.setBounds(190, 170, 100, 20);
	        
	        jTextFieldnSimulations.setText("nSimulations");
	        jframe1.getContentPane().add(jTextFieldnSimulations);
	        jTextFieldnSimulations.setBounds(100, 200, 100, 20);
	        
	        jframe1.getContentPane().add(valeurFinal);
	        valeurFinal.setBounds(10, 270, 300, 20);
	        
	        jframe1.getContentPane().add(valeurSeconde);
	        valeurSeconde.setBounds(10, 300, 300, 20);
	        
	        jButtonValidate.setBounds(100, 240, 100, 20);
	        
	        jframe1.getContentPane().add(jComboSet);
	        jframe1.getContentPane().add(jRadioMCMulti);
	        jframe1.getContentPane().add(jRadioMCSingle);
	        jframe1.getContentPane().add(jButtonValidate);
	        
	}	

	public JLabel getValeurSeconde() {
		return valeurSeconde;
	}



	public void setValeurSeconde(JLabel valeurSeconde, String text) {
		this.valeurSeconde = valeurSeconde;
		text ="Temps execution : "+text;
		valeurSeconde.setText(text);
	}



	public JLabel getValeurFinal() {
		return valeurFinal;
	}



	public void setValeurFinal(JLabel valeurFinal, String text) {
		this.valeurFinal = valeurFinal;
		text ="Resultat : "+text;
		valeurFinal.setText(text);
	}



	/**
	 * @return the jButtonValidate
	 */
	public JButton getjButtonValidate() {
		return jButtonValidate;
	}



	/**
	 * @param jButtonValidate the jButtonValidate to set
	 */
	public void setjButtonValidate(JButton jButtonValidate) {
		this.jButtonValidate = jButtonValidate;
	}



	/**
	 * @return the jComboSet
	 */
	public JComboBox getjComboSet() {
		return jComboSet;
	}



	/**
	 * @param jComboSet the jComboSet to set
	 */
	public void setjComboSet(JComboBox jComboSet) {
		this.jComboSet = jComboSet;
	}



	/**
	 * @return the numSet
	 */
	public int getNumSet() {
		return numSet;
	}



	/**
	 * @param numSet the numSet to set
	 */
	public void setNumSet(int numSet) {
		this.numSet = numSet;
	}



	/**
	 * @return the jBGroupMC
	 */
	public ButtonGroup getjBGroupMC() {
		return jBGroupMC;
	}



	/**
	 * @param jBGroupMC the jBGroupMC to set
	 */
	public void setjBGroupMC(ButtonGroup jBGroupMC) {
		this.jBGroupMC = jBGroupMC;
	}



	/**
	 * @return the jRadioMCMulti
	 */
	public JRadioButton getjRadioMCMulti() {
		return jRadioMCMulti;
	}



	/**
	 * @param jRadioMCMulti the jRadioMCMulti to set
	 */
	public void setjRadioMCMulti(JRadioButton jRadioMCMulti) {
		this.jRadioMCMulti = jRadioMCMulti;
	}



	/**
	 * @return the jRadioMCSingle
	 */
	public JRadioButton getjRadioMCSingle() {
		return jRadioMCSingle;
	}



	/**
	 * @param jRadioMCSingle the jRadioMCSingle to set
	 */
	public void setjRadioMCSingle(JRadioButton jRadioMCSingle) {
		this.jRadioMCSingle = jRadioMCSingle;
	}



	/**
	 * @return the jTextFieldCallPutFlag
	 */
	public JTextField getjTextFieldCallPutFlag() {
		return jTextFieldCallPutFlag;
	}



	/**
	 * @param jTextFieldCallPutFlag the jTextFieldCallPutFlag to set
	 */
	public void setjTextFieldCallPutFlag(JTextField jTextFieldCallPutFlag) {
		this.jTextFieldCallPutFlag = jTextFieldCallPutFlag;
	}



	/**
	 * @return the jTextFieldS
	 */
	public JTextField getjTextFieldS() {
		return jTextFieldS;
	}



	/**
	 * @param jTextFieldS the jTextFieldS to set
	 */
	public void setjTextFieldS(JTextField jTextFieldS) {
		this.jTextFieldS = jTextFieldS;
	}



	/**
	 * @return the jTextFieldX
	 */
	public JTextField getjTextFieldX() {
		return jTextFieldX;
	}



	/**
	 * @param jTextFieldX the jTextFieldX to set
	 */
	public void setjTextFieldX(JTextField jTextFieldX) {
		this.jTextFieldX = jTextFieldX;
	}



	/**
	 * @return the jTextFieldT
	 */
	public JTextField getjTextFieldT() {
		return jTextFieldT;
	}



	/**
	 * @param jTextFieldT the jTextFieldT to set
	 */
	public void setjTextFieldT(JTextField jTextFieldT) {
		this.jTextFieldT = jTextFieldT;
	}



	/**
	 * @return the jTextFieldr
	 */
	public JTextField getjTextFieldr() {
		return jTextFieldr;
	}



	/**
	 * @param jTextFieldr the jTextFieldr to set
	 */
	public void setjTextFieldr(JTextField jTextFieldr) {
		this.jTextFieldr = jTextFieldr;
	}



	/**
	 * @return the jTextFieldb
	 */
	public JTextField getjTextFieldb() {
		return jTextFieldb;
	}



	/**
	 * @param jTextFieldb the jTextFieldb to set
	 */
	public void setjTextFieldb(JTextField jTextFieldb) {
		this.jTextFieldb = jTextFieldb;
	}



	/**
	 * @return the jTextFieldv
	 */
	public JTextField getjTextFieldv() {
		return jTextFieldv;
	}



	/**
	 * @param jTextFieldv the jTextFieldv to set
	 */
	public void setjTextFieldv(JTextField jTextFieldv) {
		this.jTextFieldv = jTextFieldv;
	}



	/**
	 * @return the jTextFieldnSteps
	 */
	public JTextField getjTextFieldnSteps() {
		return jTextFieldnSteps;
	}



	/**
	 * @param jTextFieldnSteps the jTextFieldnSteps to set
	 */
	public void setjTextFieldnSteps(JTextField jTextFieldnSteps) {
		this.jTextFieldnSteps = jTextFieldnSteps;
	}



	/**
	 * @return the jTextFieldnSimulations
	 */
	public JTextField getjTextFieldnSimulations() {
		return jTextFieldnSimulations;
	}



	/**
	 * @param jTextFieldnSimulations the jTextFieldnSimulations to set
	 */
	public void setjTextFieldnSimulations(JTextField jTextFieldnSimulations) {
		this.jTextFieldnSimulations = jTextFieldnSimulations;
	}
	
	
	
	
	
}
